import { getToken } from '@/utils/auth'
import { getRoleList } from '@/api/admin/user.js'
const defaultSettings = require('../../settings.js')
export default (_self) => {
  return {
    menu: false,
    viewBtn: false,
    editBtn: false,
    delBtn: false,
    addBtn: false,
    labelWidth: 120,
    index: true,
    indexLabel: '序号',
    align: 'center',
    headerAlign: 'center',
    border: true,
    dialogWidth: '40%',
    stripe: false,
    excelBtn: true,
    selection: true,
    searchMenuSpan: 4,
    props: {
      label: 'label',
      value: 'value'
    },
    column: [
      {
        prop:'mobile',
        label: '电话',
        hide:true,
        search:true
      },
      {
        prop:'nickname',
        label: '昵称',
        hide:true,
        search:true
      },
      {
        width: 170,
        data: {
          key: getToken()
        },
        // slot: true,
        label: '用户昵称',
        prop: 'img',
        type: 'upload',
        listType: 'picture-img',
        span: 12,

        propsHttp: {
          res: 'datas'
        },
        action: defaultSettings.uploadImg,
        display: false
      },
      // {
      //     span: 12,
      //     label: '测试',
      //     prop: 'id',

      //     formslot: true,
      // },

      {
        label: '用户昵称',
        prop: 'name',

        span: 12,
        editDisabled: true,
        display: false,
        hide: true,
        searchSpan: 4,
        showColumn: false
      },

      // {
      //     label: "用户ID",
      //     prop: "id",
      //

      //     display: false,
      // },
      {
        label: 'IP地址',
        prop: 'last_login_ip'

      },


      // {
      //     component: 'elDivider', //ele分割线
      //     event: {
      //         click: () => {
      //             console.log('xxxxxxx')
      //         },
      //     },
      //     params: {
      //         html: '<h2 style="color:red">自定义html标签,点我触发方法</h2>',
      //         contentPosition: "left",
      //     }
      // },
      {
        sortable: true,
        label: '注册时间',
        prop: 'add_time',

        span: 12,
        display: false,
        type: 'datetime',
        searchRange: true,
        search: true

      },
      {
        sortable: true,
        label: '最后登录时间',
        prop: 'last_login_time',

        span: 12,
        display: false,
        type: 'datetime'

      },
      {
        editDisplay: false,
        span: 12,
        label: '是否启动',
        prop: 'state',
        search: true,
        type: 'select',
        // slot: true,
        dicData: [{
          label: '是',
          value: 1
        }, {
          label: '否',
          value: 2
        }],
        rules: [{
          required: true,
          message: '请选择状态',
          trigger: 'change'
        }]
      }

    ]
  }
}
